#include <myheader.h>

/* Usage:  */
int main(int argc, char *argv[]){                                  
    struct addrinfo*res;
    getaddrinfo("cskaoyan.com",NULL,NULL,&res);
   
    for(struct addrinfo *p=res;p!=NULL;p=p->ai_next){
        struct sockaddr*ipTag=p->ai_addr;
        if(p->ai_family==AF_INET){
            struct sockaddr_in*socketTagV4=(struct sockaddr_in*)
                ipTag;
            struct in_addr ipTagV4=socketTagV4->sin_addr;
            char*strIp=inet_ntoa(ipTagV4);
            printf("Ipv4,ip=%s  \n",strIp);
        }
    }
        
        freeaddrinfo(res);
    return 0;
}

